#include<iostream>
using namespace std;
const int N = 10;
int a[N][N];
int main()
{
	int cnt = 0;
	for (int i = 1; i <= 3; i++) {
		for (int j = 1; j <= 3; j++) {
			a[i][j] = ++cnt;
		}
	}
	int x, y;
	cin >> x >> y;
	bool flag = 0;
	if (x > y) {
		swap(x, y);
	}
	if (x == 1 && (y == 2))flag = 1;
	else if (x == 2 && (y == 3))flag = 1;
	else if (x == 4 && (y == 5))flag = 1;
	else if (x == 5 && (y == 6))flag = 1;
	else if (x == 7 && y == 8)flag = 1;
	else if (x == 8 && y == 9)flag = 1;
	if (flag)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}